package edu.bu.cs673.superkids123.parents.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="color")
public class Color {
	/**
	 * @author Abdelghani Bhalla
	 */
	@Id @GeneratedValue
	@Column(name="ColorID")
	private int id;
	
	@Column(name="ColorName")
	private String name;
	
	@Column(name="ColorCode")
	private String code;
	
	@OneToMany(mappedBy="color", fetch=FetchType.EAGER)
	private Set<SystemTheme> systemThemes = new HashSet<SystemTheme>();
	
	 
	public Set<SystemTheme> getSystemThemes() {
		return systemThemes;
	}
	public void setSystemThemes(Set<SystemTheme> systemThemes) {
		this.systemThemes = systemThemes;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}

	public Color(String name, String code)
	{
		this.name = name;
		this.code = code;
	}
	public void addTheme(SystemTheme t)
	{
		t.setColor(this);
		systemThemes.add(t);
	}
	public Color(){
		
	}

}
